import { Module } from "@nestjs/common";
import { TypeOrmModule } from "@nestjs/typeorm";
import { PrivateMessageEntity } from "../../entities/private-message.entity";
import { PrivateMessageCleanupService } from "./services/private-message-cleanup.service";
import { SchedulerController } from "./scheduler.controller";
import { UserService } from "../../services/user.service";
import { UserEntity } from "../../entities/user.entity";
import { UserAuthModule } from "../user-auth.module";

@Module({
  imports: [
    TypeOrmModule.forFeature([PrivateMessageEntity, UserEntity]),
    UserAuthModule, // 导入UserAuthModule以解决UserService的依赖
  ],
  controllers: [SchedulerController],
  providers: [PrivateMessageCleanupService, UserService],
  exports: [PrivateMessageCleanupService],
})
export class SchedulerModule {}
